package pers.lws.erp.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import pers.lws.erp.common.result.ResultBody;
import pers.lws.erp.entity.ProductFile;
import pers.lws.erp.service.IProductFileService;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author liuws
 * @since 2020-09-20
 */
@RestController
@RequestMapping("/productFile")
public class ProductFileController {

    @Autowired
    private IProductFileService productFileService;

    @GetMapping("/findAllProduct")
    public ResultBody findAllProduct() {

        QueryWrapper<ProductFile> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("use_type", "商品");
        queryWrapper.eq("checked", 2);

        List<ProductFile> list = productFileService.list(queryWrapper);

        return ResultBody.success("", list);
    }

}

